<?php
/********************************************************
 *
 * 此文件的作用:
 *		市场部后台控制器
 *
 * @copyright Copyright (c) 2008-2009
 * @author 刘昌功 lcg635@126.com
 *
 ********************************************************/
defined('APP_DIR') or die('404 Not Found');

FLEA::loadClass('Common_AdminAction');

class Controller_AdminManpower extends Common_AdminAction {
	function __construct($ctlName)   {
		parent::__construct($ctlName);
	}

	/*****************员工操作***********************************/

	function listWorkers() {
		$_modWorker = FLEA::getSingleton('Model_Worker');
		$_modUser = FLEA::getSingleton('Model_User');
		$viewData = $_modWorker->getAllWorkers($this->saveGet('page'));
		$viewData['form']['worker'] = $_modWorker->getForm('check');
		$viewData['form']['user'] = $_modUser->getForm('register');
		$this->_out('manpower/rl_worker_all', $viewData);
	}

	function rlWorkerDetail() {
		$_modUser = FLEA::getSingleton('Model_User');
		$viewData = array('user' => $_modUser->getUserInfo($this->saveGet('user_id'), 'work') );
		//dump($viewData);
		$this->_out('manpower/rl_worker_pers', $viewData);
	}
	
	function searchWorker(){
		$_modWorker = FLEA::getSingleton('Model_Worker');
		$_modUser = FLEA::getSingleton('Model_User');
		$viewData = $_modWorker->search($_POST,$this->saveGet('page'));
		$viewData['form']['worker'] = $_modWorker->getForm('check');		
		$viewData['form']['user'] = $_modUser->getForm('register');
		dump($viewData['pagerData']);
		$this->_out('manpower/rl_worker_all', $viewData);
			
	}

	/*****************员工操作结束*******************************/
}